<script setup lang="ts">
import { onMounted } from 'vue'
import TitleBar from './components/title-bar.vue'
import { managePlugin } from './plugins/managePlugin'
import { useRouter } from 'vue-router'
import { showToast } from './utils/utils'
import { appStore } from './store/app'

const appStoreObj = appStore()

const mRouter = useRouter()
onMounted(async () => {
  console.log('App mounted')
  let projectList = await managePlugin.getProjectPathRender()
  appStoreObj.setToolsName(await managePlugin.getDevToolsRender())
  if (projectList) {
    await mRouter.push('/home')
  } else {
    await mRouter.push('/setting')
    await showToast('请配置项目路径！', 'warning')
  }
})
</script>

<template>
  <title-bar></title-bar>
  <router-view class="page-inner-content-layout" />
</template>

<style lang="less">
@import './assets/css/styles.less';

.page-inner-content-layout {
  margin-top: 30px;
  height: calc(100vh - 50px);
  background: #eaeaea;
}
</style>
